Declare Sub cPushID Lib "vbhnderr.dll" (IDArray As Integer, ByVal nID As Integer)
Declare Sub cPopID Lib "vbhnderr.dll" (IDArray As Integer, ByVal nID As Integer)
Declare Sub cPopLastID Lib "vbhnderr.dll" (IDArray As Integer)
Declare Function cGetID Lib "vbhnderr.dll" (IDArray As Integer, ByVal nPosition As Integer) As Integer
Declare Sub cClearID Lib "vbhnderr.dll" (IDArray As Integer)
Declare Sub cChangeChars Lib "vbhnderr.dll" (Txt As String, charSet As String, newCharSet As String)
Declare Function cGetIni Lib "vbhnderr.dll" (ByVal AppName As String, ByVal szItem As String, ByVal szDefault As String, ByVal InitFile As String) As String
Declare Function cGetWindowsDirectory Lib "vbhnderr.dll" () As String
Declare Function cInsertBlocks Lib "vbhnderr.dll" (Txt As String, Insert As String) As String
Declare Function cLngMsgBox Lib "vbhnderr.dll" (ByVal nLanguage As Integer, ByVal Message As String, ByVal Button As Long, ByVal Title As String) As Integer
'Don't change any variables and their value below
Const ID_ITEMS = 16
Type HNDERRtype
ModuleName As String * 12
RoutineHandle As String * 4
RoutineName As String * 82
CrLf As String * 2
End Type
Dim FileLNG As String
Dim FileHND As String
Dim FileLOG As String
Dim IDArray(0 To ID_ITEMS) As Integer
Dim Language As Integer
Dim AutoLog As Integer
Dim WaitingTimeForReaction As Integer
Dim DefaultButton As Integer
Dim HNDERR As HNDERRtype
Sub mcClearID ()
Call cClearID(IDArray(0))
End Sub
Function mcGetID (nPos As Integer)
mcGetID = cGetID(IDArray(0), nPos)
End Function
Function mcGetLanguageID (LanguageID As Integer) As String
Dim RetLanguage As String
Select Case LanguageID
Case VB_LNG_FRENCH
RetLanguage = "VFR"
Case VB_LNG_DUTCH
RetLanguage = "VNL"
Case VB_LNG_GERMAN
RetLanguage = "VDE"
Case VB_LNG_ENGLISH
RetLanguage = "VUK"
Case VB_LNG_ITALIAN
RetLanguage = "VIT"
Case VB_LNG_SPANISH
RetLanguage = "VSP"
Case Else
RetLanguage = "VUK"
End Select
If (LanguageID > 0) Then
Language = LanguageID
Else
Language = VB_LNG_ENGLISH
End If
mcGetLanguageID = RetLanguage
End Function
Function mcIDErrorHandler (nErr As Integer) As Integer
' check if this a correct Error passed
If (nErr = 0) Then
'if no, resume next
mcIDErrorHandler = True
Exit Function
End If
Dim RoutineCount As Integer
Dim RoutineNumber As Integer
Dim RoutineStack As String
Dim TotalRoutines As Integer
Dim BlankLines As Integer
Dim Chan As Integer
Dim StopExit As Integer
Dim TimeOut As Long
Dim ButtonsConfig As Integer
Dim ErrorTitle As String
' some initializations
RoutineStack = ""
TotalRoutines = 0
BlankLines = 0
StopExit = False
ButtonsConfig = 0
ErrorTitle = ""
RoutineStack = RoutineStack + mcReadText("0", "")
' find the next valid unused file number.
Chan = FreeFile
' open the file with the definition of each routines (file must be in the WINDOWS directory)
Close #Chan
Open FileHND For Random Shared As #Chan Len = Len(HNDERR)
' get the stack of the routines
For RoutineCount = 0 To ID_ITEMS
' get the number of the routine
RoutineNumber = mcGetID(RoutineCount)
' if there a valid routine number
If (RoutineNumber > 0) Then
' yes, read the definition of the routine
Get #Chan, RoutineNumber, HNDERR
' form the stack of the routines founden to display